package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.entity.sfgl.Sfk;
import com.hnkywl.sts.service.sfgl.FkshService;
import com.hnkywl.sts.service.sfgl.SkshService;
import com.hnkywl.sts.util.ApplicationInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: 灵韵
 * Date: 13-8-13
 * Time: 下午4:09
 * To change this template use File | Settings | File Templates.
 */
public class EndFkState implements EventListener {
    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        FkshService fkshService = ApplicationInstance.createFkshService();
        Sfk sfk = fkshService.findSfkDetailByProcessInstance(execution.getProcessInstance().getId());
        sfk.setZt("ysh");
        fkshService.updateFksh(sfk);
    }
}
